﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WPF.DataProvider
{
    public class Person : INotifyPropertyChanged
    {
        private string _NameValue;
        public string Name
        {
            get { return _NameValue; }
            set { _NameValue = value; }
        }

        private int _AgeValue;
        public int Age
        {
            get { return _AgeValue; }
            set
            {
                if (value != _AgeValue)
                {
                    _AgeValue = value;
                    OnPropChanged("Age");
                }

            }
        }


        public event PropertyChangedEventHandler PropertyChanged;
        private void OnPropChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

    }
}
